namespace :composer do
  task :install do
    on roles fetch(:composer_roles) do
      within fetch(:composer_target_path, release_path) do
        execute :composer, 'install', fetch(:composer_flags)
      end
    end
  end
end

namespace :load do
  task :defaults do
    set :composer_flags, %w(--no-dev --prefer-dist -n -q)
    set :composer_roles, :all
  end
end
